/* 
 * File:   Color.cpp
 * Author: claudio
 * 
 * Created on March 15, 2013, 9:03 AM
 */

#include "Color.h"

Color::Color(int hue, int saturation, int value, int numPixels){
    this->setHue(hue);
    this->saturation = saturation;
    this->value = value;
    this->numPixels = numPixels;
}


Color::~Color() {
}

int Color::getHue() {
        return hue;
}

void Color::setHue(int hue) {
        this->hue = hue;
        defineColor(hue);
}

int Color::getSaturation() {
        return saturation;
}

void Color::setSaturation(int saturation) {
        this->saturation = saturation;
}

int Color::getValue() {
        return value;
}

void Color::setValue(int value) {
        this->value = value;
}

int Color::getNumPixels() {
        return numPixels;
}

void Color::setNumPixels(int numPixels) {
        this->numPixels = numPixels;
}
void Color::defineColor(int hue) {
		if (hue >= 0 && hue < 10) {
			this->colorName = RED;
		} else if (hue >= 10 && hue < 40) {
			this->colorName = ORANGE;
		} else if (hue >= 40 && hue < 75) {
			this->colorName = YELLOW;
		} else if (hue >= 75 && hue < 150) {
			this->colorName = GREEN;
		} else if (hue >= 150 && hue < 250) {
			this->colorName = BLUE;
		} else if (hue >= 250 && hue < 340) {
			this->colorName = VIOLET;
		} else if (hue >= 340 && hue <= 360) {
			this->colorName = RED;
		} else {
//			System.out.println("Values between 0 - 360");
		}
	}
EnumColor Color::getColorName(){
    return this->colorName;
}